package Main2;

import java.awt.peer.SystemTrayPeer;
import java.util.Scanner;

public class Main10_12 {
    //查找组成一个偶数最接近的两个素数
    public static void main(String[] args) {
        //1. 俩数都得是素数  2.保证差值最小就得从中间开始判断
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            int num = scan.nextInt();
            //从中间开始求解
            int half = num / 2;
            for (int i = half; i < num; i++) {
                if (isPrime(i) && isPrime(num - i)){
                    System.out.println(num -i);
                    System.out.println(i);
                    break;
                }
            }
        }
    }
    //判断是否为素数
    public static boolean isPrime(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0) return false;
        }
        return true;
    }

    //二进制插入
    public int binInsert(int n, int m, int j, int i) {
        m <<= j;
        return n | m;
    }

    //求最大连续bit数
    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            int n = scan.nextInt();
            int count = 0;
            int sum = 0;
            while (n != 0) {
                if ((n & 1) == 1) {
                    count++;
                    sum = Math.max(count, sum);
                }else count = 0;
            }
            System.out.println(sum);
        }
    }

    //二叉树最忌公共祖先
    public int getLCA(int a, int b) {
        while (a != b) {
            if (a > b) a /= 2;
            else b /= 2;
        }
        return a;
    }

    //井字棋
    /*思路：看横排竖排主对角线和副对角线 的数字和是否等于3*/
    public boolean checkWon(int[][] board) {
        int n = board.length;
        int sum = 0;
        int i = 0;//行下标
        int j = 0;//列下标
        for (i = 0; i < n; i++) {
            //每次进行计算的时候sum 要记得清零
            sum = 0;
            for (j = 0; j < n; j++) {
                sum += board[i][j];//行号不变，列号变
            }
            if (sum == n) return true;
        }
        for (i = 0; i < n; i++) {
            sum = 0;
            for (j = 0; j < n; j++) {
                sum += board[j][i];//行号变，列号不变
            }
            if (sum == n) return true;
        }
        //判断主对角线
        sum = 0;
        for (i = 0; i < n; i++) {
            sum += board[i][i];
            if (sum == n) return true;
        }
        sum = 0;
        for (i = 0; i < n; i++) {
            sum += board[i][n-1-i];
            if (sum == n) return true;
        }
        return false;
    }
    //密码强度等级
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            String str = scan.next();
            int sum1 = getLen(str);
            int sum2 = getLetter(str);
            int sum3 = getNum(str);
            int sum4 = getChar(str);
            int sum = 0;
            //奖励
            if (sum2 == 20 && sum3 > 0 && sum4 > 0)
                sum = sum1 + sum2 + sum3 + sum4 + 5;
            else if (sum2 == 10 && sum3 > 0 && sum4 > 0)
                sum = sum1 + sum2 + sum3 + sum4 + 3;
            else if (sum2 == 10 && sum3 > 0 && sum4 == 0)
                sum = sum1 + sum2 + sum3 + sum4 + 2;
            else
                sum = sum1 + sum2 + sum3 + sum4;

            //评分
            if (sum >= 90) System.out.println("VERY_SECURE");
            if (sum >= 80) System.out.println("SECURE");
            if (sum >=70) System.out.println("VERY_STRONG");
            if (sum >= 60) System.out.println("STRONG");
            if (sum >= 50) System.out.println("AVERAGE");
            if (sum >= 25) System.out.println("WEAK");
            else System.out.println("VERY_WEAK");
        }

    }
    private static int getChar(String str) {
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (!(ch >= 65 && ch <= 90) &&
                    !(ch >=97 && ch <= 122) &&
                    !(ch - '0' >= 0 && ch - '0' <= 9)){
                count++;
            }
        }
        if (count > 1) return 25;
        if (count == 1) return 10;
        else return 0;
    }

    private static int getNum(String str) {
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch - '0' >= 0 && ch - '0' <= 9) count++;
        }
        if (count > 1) return 20;
        if (count == 1) return 10;
        else return 0;
    }

    private static int getLen(String str) {
        int len = str.length();
        if (len >= 8) return 25;
        else if (len >=5 && len <=7) return 10;
        else return 5;
    }

    private static int getLetter(String str) {
        int small = 0, big = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch >= 65 && ch <= 90) big++;
            else if (ch >= 97 && ch<= 122) small++;
        }
        if (small > 0 && big > 0) return 20;
        if (small > 0 || big > 0) return 10;
        else return 0;
    }
}
